ShowTable of Contents
Introduction
This article is part of the
XPages Extensibility API Developers Guide.
This article shows you step-by-step (with screenshots and code samples) how to create an XPages library by starting with the blank library provided and changing it as required.
When creating a new XPages Library, you can start by importing the blank library attached below then follow the instructions in this article.
If you are not familiar with the XPages library contents, you may want to start with the article "
Creating an XPages Library".
Import the library
In Domino Designer, switch to the Java perspective; select Window - "Open Perspective" - Other... - Java - OK.
Download the
blank library archive. This contains a plugin, feature and update site.
Next, select File - Import... - General - "Existing Projects into Workspace" - Next - Select archive file - Finish.
Rename the feature
In the Package Explorer, right-click the feature and select Refactor - Rename. Enter a new name (e.g. "com.acme.xsp.feature") and select OK.
Next, open the file "feature.xml". In the Overview tab, enter the new ID, Name and Provider.
Change the feature in the update site
Open the update site's "site.xml" file. In the "Site Map" tab, right-click the old feature and select Remove.
Next, select "Add Feature..." - Select the new feature name - OK.
Changing the plugin
Rename the plugin
In the Package Explorer, right-click the plugin and select Refactor - Rename. Enter a new name (e.g. "com.acme.xsp") and select OK.
Next, open the file "META-INF/MANIFEST.MF". In the Overview tab, enter the new Name and Provider.
Change the plugin ID in the library
Open the library class (e.g. "ExampleBlankLibrary.java") and change the getPluginId method.
public String getPluginId() {
return "com.acme.xsp";
}
Change the plugin in the feature
Open the feature's "feature.xml" file. In the Plugins tab, right-click the old plugin and select Delete.
Next, select "Add..." - Select the new plugin name - OK.
Rename each package
In the Package Explorer, right-click each package and select Refactor - Rename. Enter a new name, enable all check boxes and select Preview - OK.
Rename the library
In the library package, right-click the library class and select Refactor - Rename. Enter a new name, enable all check boxes and select Next - Finish.
Change the control's xsp-config file
Open the control's xsp-config file (e.g. "orangeBox.xsp-config") and change the namespace-uri and default-prefix.
<faces-config-extension>
<namespace-uri>http://acme.com/xsp/</namespace-uri>
<default-prefix>ac</default-prefix>
</faces-config-extension>
You may also want to rename the control or remove it and create your own.